import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

public class DecimalFormatDemo { 
  static public void main(String[] args) {
 
    DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols(
            Locale.getDefault());
        unusualSymbols.setDecimalSeparator(',');
        unusualSymbols.setGroupingSeparator('.');
        String strange = "#,###.###";
        DecimalFormat weirdFormatter = new DecimalFormat(strange,unusualSymbols);
        weirdFormatter.setGroupingSize(3);
        String bizarre = weirdFormatter.format(1232456.783239);
        System.out.println(bizarre);    
  }
}
//Thanh added 
